]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
Make width of workspace switcher popup dynamic
authorMads Villadsen <maxx@krakoa.dk>
Tue, 16 Feb 2010 21:34:57 +0000 (22:34 +0100)
committerAdel Gadllah <adel.gadllah@gmail.com>
Mon, 22 Feb 2010 19:29:49 +0000 (20:29 +0100)
Make the width of the workspace switcher dynamic in order to make it have the same proportions as the actual screen.

Call redraw after adding indicator to stage to avoid warning.

https://bugzilla.gnome.org/show_bug.cgi?id=610049

Signed-off-by: Adel Gadllah <adel.gadllah@gmail.com>
data/theme/gnome-shell.css
js/ui/workspaceSwitcherPopup.js

index b2c816f4c95a7d8f19ed0e9358e07135fa910fa5..c8cd4191af146dc9ee3f0e3c932ad87aead8d7b4 100644 (file)
@@ -703,7 +703,6 @@ StTooltip {
 }
 
 .ws-switcher-active-left {
-    width: 98px;
     height: 98px;
     border: 0px;
     background: rgba(255,255,255,0.5);
@@ -712,7 +711,6 @@ StTooltip {
 }
 
 .ws-switcher-active-right {
-    width: 98px;
     height: 98px;
     border: 0px;
     background: rgba(255,255,255,0.5);
@@ -729,7 +727,6 @@ StTooltip {
 }
 
 .ws-switcher-box {
-    width: 96px;
     height: 96px;
     border: 2px solid rgba(85,85,85,0.5);
     background: transparent;
index 655779c70c181ef4ea0e7d86a5101c0bba5fde54..31e380f1742d24f8947fc2c354bc29efb754127d 100644 (file)
@@ -27,14 +27,17 @@ WorkspaceSwitcherPopup.prototype = {
                                          height: global.screen_height });
         global.stage.add_actor(this.actor);
 
+        this._scaleWidth = global.screen_width / global.screen_height;
+
         this._container = new St.BoxLayout({ style_class: "workspace-switcher-container" });
         this._list = new St.BoxLayout({ style_class: "workspace-switcher" });
 
-        this._redraw();
-
         this._container.add(this._list);
+
         this.actor.add_actor(this._container);
 
+        this._redraw();
+
         this._position();
 
         this.actor.show();
@@ -55,6 +58,7 @@ WorkspaceSwitcherPopup.prototype = {
                indicator = new St.Bin({ style_class: 'ws-switcher-box' });
 
            this._list.add(indicator);
+           indicator.set_width(Math.round(indicator.get_height() * this._scaleWidth));
 
            if (i < global.screen.n_workspaces - 1) {
                let spacer = new St.Bin({ style_class: 'ws-switcher-spacer' });